# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-hatch-vcs
pkgver=0.2.0
pkgrel=0
pkgdesc="Hatch plugin for versioning with your preferred VCS"
url="https://github.com/ofek/hatch-vcs"
arch="noarch"
license="MIT"
depends="python3 py3-hatchling py3-setuptools_scm"
makedepends="py3-build py3-installer py3-wheel"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/h/hatch-vcs/hatch_vcs-$pkgver.tar.gz"
builddir="$srcdir/hatch_vcs-$pkgver"

build() {
	python3 -m build --skip-dependency-check --no-isolation --wheel .
}

check() {
	python3 -m installer -d testenv \
		dist/hatch_vcs-$pkgver-py2.py3-none-any.whl
	local sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
	PYTHONPATH="$PWD/testenv/$sitedir" python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/hatch_vcs-$pkgver-py2.py3-none-any.whl
}

sha512sums="
3eb0b04022d4801a982d90a3a0e34e59fcf7dd04c0c2db91c0306b4187ba466ac85ecbb80943a35f4a6a4912bc2ddf2633fab897e8820f5e1ee9d200147b5faf  hatch_vcs-0.2.0.tar.gz
"
